package com.lanvideo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 静态页面控制器
 */
@Controller
public class StaticController {

    /**
     * 测试页面
     */
    @GetMapping("/test")
    @ResponseBody
    public String test() {
        return "应用运行正常！当前时间: " + java.time.LocalDateTime.now();
    }

    /**
     * 管理员考试管理页面
     */
    @GetMapping("/admin/exam-management")
    public String adminExamManagement() {
        return "forward:/admin/exam-management.html";
    }

    /**
     * 管理员系统管理页面
     */
    @GetMapping("/admin/system-management")
    public String adminSystemManagement() {
        return "forward:/admin/system-management.html";
    }


    /**
     * 管理员仪表盘
     */
    @GetMapping("/admin/dashboard")
    public String adminDashboard() {
        return "forward:/admin/dashboard.html";
    }

    /**
     * 老师仪表盘
     */
    @GetMapping("/teacher/dashboard")
    public String teacherDashboard() {
        return "forward:/teacher/dashboard.html";
    }

    /**
     * 学生首页
     */
    @GetMapping("/student/index")
    public String studentIndex() {
        return "forward:/student/index.html";
    }

    /**
     * 登录页面
     */
    @GetMapping("/login")
    public String login() {
        return "forward:/login.html";
    }

    // ==================== 管理员页面路由 ====================
    
    /**
     * 管理员考试页面（重定向到exam-management）
     */
    @GetMapping("/admin/exams")
    public String adminExams() {
        return "forward:/admin/exams.html";
    }

    /**
     * 管理员视频管理
     */
    @GetMapping("/admin/videos")
    public String adminVideos() {
        return "forward:/admin/videos.html";
    }

    /**
     * 管理员用户管理
     */
    @GetMapping("/admin/users")
    public String adminUsers() {
        return "forward:/admin/users.html";
    }

    // ==================== 老师页面路由 ====================
    
    /**
     * 老师考试管理
     */
    @GetMapping("/teacher/exams")
    public String teacherExams() {
        return "forward:/teacher/exam-management.html";
    }

    /**
     * 老师考试详情
     */
    @GetMapping("/teacher/exam-detail")
    public String teacherExamDetail() {
        return "forward:/teacher/exam-detail.html";
    }

    /**
     * 老师视频管理
     */
    @GetMapping("/teacher/videos")
    public String teacherVideos() {
        return "forward:/teacher/videos.html";
    }

    /**
     * 老师视频上传
     */
    @GetMapping("/teacher/upload")
    public String teacherUpload() {
        return "forward:/teacher/upload.html";
    }

    // ==================== 学生页面路由 ====================
    
    /**
     * 学生考试列表
     */
    @GetMapping("/student/exams")
    public String studentExams() {
        return "forward:/student/exams.html";
    }

    /**
     * 学生考试记录
     */
    @GetMapping("/student/exam-records")
    public String studentExamRecords() {
        return "forward:/student/exam-records.html";
    }

    /**
     * 学生收藏
     */
    @GetMapping("/student/favorites")
    public String studentFavorites() {
        return "forward:/student/favorites.html";
    }

    /**
     * 学生播放列表
     */
    @GetMapping("/student/playlists")
    public String studentPlaylists() {
        return "forward:/student/playlists.html";
    }
}
